'''
Created on Jul 14, 2012

@author: charlie
'''

import pygame
import csv

pokedex=[]
IV=31
EV=252

data=csv.reader(open('..\data\pokemon.csv'), delimiter=',', quotechar='/')
for row in data:
    pokedex.append(row)    

class pokemon:

    def __init__ (self, ID=37, level=100, nature=1):
        self.ID=ID
        self.level=level
        self.nature=nature
        
    def name(self):    
        self.name=pokedex[self.ID][1]
        return self.name
        
    def HP (self):
        self.HP=pokedex[self.ID][2]
        HitP=int(((IV+(2*int(pokedex[self.ID][2]))+(EV/4)+100)*self.level/100)+10)
        HP=[HitP, HitP]
        return HP
    
    def attack (self):
        self.attack=pokedex[self.ID][3]
        att=int((((IV+(2*int(pokedex[self.ID][3]))+(EV/4))*self.level)/100)+5)
        attack=[att, att]
        return attack
    
    def defense (self):
        self.defense=pokedex[self.ID][4]
        DEF=int((((IV+(2*int(pokedex[self.ID][4]))+(EV/4))*self.level)/100)+5)
        defense=[DEF, DEF]
        return defense
    
    def SPattack (self):
        self.SPattack=pokedex[self.ID][5]
        SPatt=int((((IV+(2*int(pokedex[self.ID][5]))+(EV/4))*self.level)/100)+5)
        SPattack=[SPatt, SPatt]
        return SPattack
    
    def SPdefense (self):
        self.SPdefense=pokedex[self.ID][6]
        SPdef=int((((IV+(2*int(pokedex[self.ID][6]))+(EV/4))*self.level)/100)+5)
        SPdefense=[SPdef,SPdef]
        return SPdefense
    
    def speed (self):
        self.speed=pokedex[self.ID][7]
        spd=int((((IV+(2*int(pokedex[self.ID][7]))+(EV/4))*self.level)/100)+5)
        speed=[spd, spd]
        return speed
        
    def type1 (self):
        self.type_1=pokedex[self.ID][8]
        return self.type_1
    
    def type2 (self):
        self.type_2=pokedex[self.ID][9]
        return self.type_2
        
    def moves (self, m1, m2, m3, m4):
        self.m1=move(m1)
        self.m2=move(m2)
        self.m3=move(m3)
        self.m4=move(m4)
        movelist=[self.m1, self.m2, self.m3, self.m4]
        return movelist

mmmmm=pokemon(3)
print(mmmmm.name(), mmmmm.HP(), mmmmm.attack(), mmmmm.defense(), mmmmm.SPattack(), mmmmm.SPdefense(), mmmmm.speed(), mmmmm.type1(), mmmmm.type2())